//
//  ReturnPolicyViewController.m
//  YiShangPin
//
//  Created by 衣尚品1 on 15/3/25.
//  Copyright (c) 2015年 yishangpin2. All rights reserved.
//

#import "ReturnPolicyViewController.h"
#import "AppDelegate.h"

@interface ReturnPolicyViewController (){
    AppDelegate *delegate;
}

@end

@implementation ReturnPolicyViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    delegate = [[UIApplication sharedApplication] delegate];
    
    
}

- (void)viewWillAppear:(BOOL)animated{
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, self.view.frame.size.width-20, self.view.frame.size.height)];
    label.lineBreakMode = NSLineBreakByWordWrapping;
    label.numberOfLines = 0;
    if ([delegate.whichView isEqualToString:@"ReturnPolicyDetails"]) {
        self.titleLabel.text = @"Return Policy";
        
        label.text = @"We want to be completely satisfied with your purchase on Wish. \n\nYou may return all products within 30 days of delivery. \n\nYou can initate a return or a refund on items from your Order History page. Simply click on 'Contact Support' next to the item you wish to request a retrun or a refund and Wish Support will be ready to assist. \n\nWe aim to process all requests within 72 hours upon receiving. Refunds are issued back to the original form of payment used to purchase the order. \n\nIn tne event that a Wish gift card is applied to an order and that order is refunded for any reason, any gift cards used in that order will not be refunded. \n\nAt this time, Wish cannot refund, reimburse, cover, or otherwise be responsible for any fees not paid to Wish. This includes any customs taxes or VAT as well as any return shipping costs you may incur in the refund process.";
        //        label.backgroundColor = [UIColor blueColor];
        if (delegate.width < 330) {
            label.font = [UIFont fontWithName:@"TimesNewRomanPSMT" size:15];
        }
        else{
            label.font = [UIFont fontWithName:@"TimesNewRomanPSMT" size:18];
        }
    }
    if ([delegate.whichView isEqualToString:@"ReadMore"]) {
        self.titleLabel.text = @"Description";
        
        if (delegate.width < 330) {
            label.font = [UIFont fontWithName:@"TimesNewRomanPSMT" size:18];
        }
        else{
            label.font = [UIFont fontWithName:@"TimesNewRomanPSMT" size:20];
        }
//        label.text = @"Show Color BlackFabric Chiffon Available Size:S/M/L/XlBust:110cm Length:78cm Waist:68cmBust:112cm Length:80cm Waist:70cmBust:114cm Lenght:82cm Waist:72cmBust:116cm Length:84cm Waist:74cm";
        label.text = delegate.detailsDic[@"description"];
        
        CGSize size = [label.text boundingRectWithSize:CGSizeMake(self.view.frame.size.width-20, 1000) options:NSStringDrawingUsesLineFragmentOrigin attributes:[NSDictionary dictionaryWithObjectsAndKeys:label.font,NSFontAttributeName, nil] context:nil].size;
        
        label.frame = CGRectMake(10, 65, self.view.frame.size.width-20, size.height);

        
    }
    
    
    
    [self.view addSubview:label];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)dismissSelf:(id)sender {
    [self dismissViewControllerAnimated:YES completion:nil];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
